package argirithm;

import java.util.Random;

public class Demo08 {
    public static void main(String[] args) {
        String str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"+
                "abcdefghijklmnopqrstuvwxyz"+
                "0123456789-_";
        char[] chars = new char[6];
        Random random = new Random();
        for (int i = 0; i <chars.length ; i++) {
            chars[i] = str.charAt(random.nextInt(str.length()));
        }
        //进行加密
        StringBuilder sb = new StringBuilder();
        for (char c: chars) {
            System.out.println(c);
            if (c>'A'&&c<'Z'){
                sb.append((char)(c+32));
            }else if (c>'a'&& c<'z'){
                sb.append((char)(c-32));
            }else if (c>'0'&& c<'9'){
                int n = c - '0';
                System.out.println("123123:"+n);
                for (int i = 0; i <n ; i++) {
                    sb.append(n);
                }
            }else{
                sb.append("\\").append(c=='-'?'_':'-');
            }
        }
        System.out.println(sb);
    }

}
